package br.com.exemplo.swing;

import java.awt.GridLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class ExemploGridLayout {
	

	public static void main(String[] args) {
		JFrame janela = new JFrame("Exemplo Grid Layout");
		
		JPanel painel = new JPanel();
		painel.setLayout(new GridLayout(2, 3));
		
		janela.add(painel);
		
		JTextField textField1 = new JTextField(10);
		JTextField textField2 = new JTextField(10);
		JTextField textField3 = new JTextField(10);
		JTextField textField4 = new JTextField(10);
		JTextField textField5 = new JTextField(10);
		
		painel.add(textField1);
		painel.add(textField2);
		painel.add(textField3);
		painel.add(textField4);
		painel.add(textField5);

		janela.pack();
		janela.setSize(540, 540);
		janela.setVisible(true);
		janela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
	
}
